﻿using System;
using System.Collections.Generic;
namespace ApiBetaSeries.Services
{
    /// <summary>
    /// Provides services for episodes
    /// </summary>
    public interface IEpisodeServices
    {
        /// <summary>
        /// Mark the episode as downloaded on betaseries
        /// </summary>
        /// <param name="token">token of the member</param>
        /// <param name="urlSerie">url of the show</param>
        /// <param name="season">season number of the episode</param>
        /// <param name="numEpisode">episode number</param>
        /// <returns>if the episode is downloaded</returns>
        bool SetEpisodeDownloaded(string token, string urlSerie, int season, int numEpisode);
        /// <summary>
        /// Mark the episode as downloaded on betaseries
        /// </summary>
        /// <param name="user">the member</param>
        /// <param name="urlSerie">url of the show</param>
        /// <param name="season">season number of the episode</param>
        /// <param name="numEpisode">episode number</param>
        /// <returns>if the episode is downloaded</returns>
        bool SetEpisodeDownloaded(IUser user, string urlSerie, int season, int numEpisode);
        /// <summary>
        /// Mark the episode as watched on betaseries
        /// </summary>
        /// <param name="user">member who have watched the episode</param>
        /// <param name="urlSerie">url of the show</param>
        /// <param name="season">season number of the episode</param>
        /// <param name="numEpisode">episode number</param>
        /// <param name="note">note of the episode (default : none)</param>
        void SetEpisodeWatched(IUser user, string urlSerie, int season, int numEpisode, int note = -1);
        /// <summary>
        /// Mark the episode as watched on betaseries
        /// </summary>
        /// <param name="token">token of the member</param>
        /// <param name="urlSerie">url of the show</param>
        /// <param name="season">season number of the episode</param>
        /// <param name="numEpisode">episode number</param>
        /// <param name="note">note of the episode (default : none)</param>
        void SetEpisodeWatched(string token, string urlSerie, int season, int numEpisode, int note = -1);

        /// <summary>
        /// get all episodes of the member
        /// </summary>
        /// <param name="token">token of the member</param>
        /// <param name="type">VO/VOVF/All</param>
        /// <param name="next">Only the next episode to watch</param>
        /// <returns>list of episode</returns>
        List<IEpisode> GetEpisodes(string token, TypeEpisode type = TypeEpisode.All, bool next = false);

        /// <summary>
        /// get all episodes of the member
        /// </summary>
        /// <param name="user">the member</param>
        /// <param name="type">VO/VOVF/All</param>
        /// <param name="next">Only the next episode to watch</param>
        /// <returns>list of episode</returns>
        List<IEpisode> GetEpisodes(IUser user, TypeEpisode type = TypeEpisode.All, bool next = false);

        /// <summary>
        /// Get a specific episode of a show
        /// </summary>
        /// <param name="url">url of the show</param>
        /// <param name="seasonNumber">season of the episode</param>
        /// <param name="episodeNumber">episode number</param>
        /// <param name="token">Token of the user</param>
        /// <returns>the episode</returns>
        IEpisode GetEpisode(string url, int seasonNumber, int episodeNumber, string token = null);

        /// <summary>
        /// Get a specific episode of a show
        /// </summary>
        /// <param name="url">url of the show</param>
        /// <param name="seasonNumber">season of the episode</param>
        /// <param name="episodeNumber">episode number</param>
        /// <param name="user">the member</param>
        /// <returns>the episode</returns>
        IEpisode GetEpisode(string url, int seasonNumber, int episodeNumber, IUser user);

        /// <summary>
        /// Mark an episode
        /// </summary>
        /// <param name="token">token of the member</param>
        /// <param name="urlShow">url of the show</param>
        /// <param name="season">season number</param>
        /// <param name="episode">episode number</param>
        /// <param name="mark">mark of this episode</param>
        void SetMark(string token, string urlShow, int season, int episode, int mark);
        /// <summary>
        /// Mark an episode
        /// </summary>
        /// <param name="user">the member</param>
        /// <param name="urlShow">url of the show</param>
        /// <param name="season">season number</param>
        /// <param name="episode">episode number</param>
        /// <param name="mark">mark of this episode</param>
        void SetMark(IUser user, string urlShow, int season, int episode, int mark);
    }
}
